.app {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  border-radius: 8px;
  margin-top: 50px;
  transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
}

/* 明亮主题 (默认) */
:root.light {
  --bg-color: #f5f5f5;
  --app-bg: white;
  --text-color: #333;
  --border-color: #ddd;
  --primary-color: #4caf50;
  --primary-hover: #45a049;
  --delete-color: #f44336;
  --delete-hover: #d32f2f;
  --completed-color: #888;
  --shadow-color: rgba(0, 0, 0, 0.1);
}

/* 暗黑主题 */
:root.dark {
  --bg-color: #121212;
  --app-bg: #1e1e1e;
  --text-color: #e0e0e0;
  --border-color: #333;
  --primary-color: #66bb6a;
  --primary-hover: #81c784;
  --delete-color: #e57373;
  --delete-hover: #ef5350;
  --completed-color: #757575;
  --shadow-color: rgba(0, 0, 0, 0.3);
}

/* 应用全局主题变量 */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

.app {
  background-color: var(--app-bg);
  color: var(--text-color);
  box-shadow: 0 0 10px var(--shadow-color);
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h1 {
  text-align: center;
  color: var(--text-color);
  margin: 0;
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: background-color 0.3s;
}

.theme-toggle:hover {
  background-color: var(--border-color);
}

.todo-form {
  display: flex;
  margin-bottom: 20px;
  margin-top: 20px;
}

.todo-input {
  flex-grow: 1;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px 0 0 4px;
  font-size: 16px;
  background-color: var(--app-bg);
  color: var(--text-color);
}

.todo-button {
  padding: 10px 15px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-size: 16px;
}

.todo-button:hover {
  background-color: var(--primary-hover);
}

.todo-list {
  list-style-type: none;
  padding: 0;
}

.todo-item {
  display: flex;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
}

.todo-item:last-child {
  border-bottom: none;
}

.todo-checkbox {
  margin-right: 10px;
  cursor: pointer;
}

.todo-text {
  flex-grow: 1;
  margin: 0;
}

.todo-text.completed {
  text-decoration: line-through;
  color: var(--completed-color);
}

.todo-delete {
  background-color: var(--delete-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
}

.todo-delete:hover {
  background-color: var(--delete-hover);
}

.empty-message {
  text-align: center;
  color: var(--completed-color);
  font-style: italic;
}

/* 导航样式 */
.app-nav {
  display: flex;
  justify-content: center;
  margin-top: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.app-nav button {
  margin: 0 15px;
  color: var(--text-color);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background-color 0.2s;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
}

.app-nav button:hover {
  background-color: var(--border-color);
}

.app-nav button.active {
  background-color: var(--primary-color);
  color: white;
}

/* 过滤器样式 */
.todo-filter {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.filter-btn {
  background: none;
  border: 1px solid var(--border-color);
  padding: 5px 15px;
  margin: 0 5px;
  cursor: pointer;
  border-radius: 4px;
  color: var(--text-color);
  transition: all 0.2s;
}

.filter-btn:hover {
  background-color: var(--border-color);
}

.filter-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* 表单验证样式 */
.form-group {
  position: relative;
  flex-grow: 1;
}

.input-error {
  border-color: var(--delete-color) !important;
}

.error-message {
  position: absolute;
  color: var(--delete-color);
  font-size: 12px;
  margin-top: 5px;
}

/* 编辑模式样式 */
.todo-edit-input {
  flex-grow: 1;
  padding: 5px;
  border: 1px solid var(--primary-color);
  border-radius: 4px;
  font-size: 16px;
  background-color: var(--app-bg);
  color: var(--text-color);
}

.todo-actions {
  display: flex;
}

.todo-edit {
  background: none;
  border: none;
  cursor: pointer;
  margin-right: 5px;
  font-size: 16px;
}

/* 统计页面样式 */
.todo-stats {
  padding: 20px;
}

.stats-container {
  display: flex;
  justify-content: space-between;
  margin: 30px 0;
}

.stat-item {
  text-align: center;
  flex: 1;
}

.stat-value {
  font-size: 36px;
  font-weight: bold;
  color: var(--primary-color);
}

.stat-label {
  margin-top: 5px;
  color: var(--text-color);
}

.progress-bar-container {
  height: 20px;
  background-color: var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  margin: 20px 0;
}

.progress-bar {
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

/* 帮助页面样式 */
.todo-help {
  padding: 20px;
}

.help-section {
  margin-bottom: 30px;
}

.help-section h3 {
  margin-bottom: 10px;
  color: var(--primary-color);
}

.help-section ul {
  padding-left: 20px;
}

.help-section li {
  margin-bottom: 10px;
} 